import http from '@/utils/http'
export function getCartListAPI() {
	return http.get('/member/cart')
}

export function addCartAPI(data) {
	return http.post('/member/cart', data)
}

export function updateCartAPI(id, selected, count) {
	return http({
		url: `/member/cart/${id}`,
		method: 'PUT',
		data: {
			selected,
			count
		}
	})
}

export function deleteCartAPI(ids) {
	return http({
		url: '/member/cart',
		method: 'DELETE',
		data: {
			ids
		}
	})
}

export function updateAllCartAPI(selected, ids) {
	return http({
		url: '/member/cart/selected',
		method: 'PUT',
		data: {
			selected,
			ids
		}
	})
}

export function mergeCartAPI(data) { 
	return http({
		url: '/member/cart/merge',
		method: 'POST',
		data
	})
}